package com.workcenter.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.workcenter.entity.shiro.PermsEntity;
import com.workcenter.entity.shiro.RoleEntity;
import com.workcenter.entity.shiro.UserEntity;
import com.workcenter.mapper.ShiroMapper;
import com.workcenter.service.ShiroService;


@Service
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public class ShiroServiceImpl implements ShiroService {

  @Autowired
  private ShiroMapper shiroMapper;

  @Override
  public List<UserEntity> findUser(String username) {
    return shiroMapper.findUser(username);
  }

  @Override
  public List<RoleEntity> findRoles(Long userId) {
    return shiroMapper.findRoles(userId);
  }

  @Override
  public List<PermsEntity> findPerms(Long userId) {
    return shiroMapper.findPerms(userId);
  }
}
